﻿<Window x:Class="BNPP.TemperatureConverter.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      DataContext="{Binding Path=MainPage, Source={StaticResource Locator}}"
      xmlns:mvvm="clr-namespace:BNPP.TemperatureConverter.Frameworks.MVVM"
    Title="Temperature Converter (C) Arup Banerjee, 2015" Height="300" Width="550" ResizeMode="NoResize">

    <Border Width="525" Height="275" BorderThickness="3" BorderBrush="WhiteSmoke" CornerRadius="10" Margin="5,5,5,5"
        HorizontalAlignment="Center" VerticalAlignment="Center">
        <Grid>
            <Grid.Resources>
                <Style x:Key="titleText" TargetType="{x:Type Label}">
                    <Setter Property="FontWeight" Value="Bold"/>
                    <Setter Property="FontSize" Value="24"/>
                    <!--<Setter Property="Margin" Value="10,5,10,10"/>-->
                    <Setter Property="Background" Value="WhiteSmoke"/>
                    <Setter Property="HorizontalContentAlignment" Value="Center"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="VerticalContentAlignment" Value="Center"/>
                    <Setter Property="VerticalAlignment" Value="Stretch"/>
                </Style>
                <ControlTemplate x:Key="TextBoxBaseControlTemplate" TargetType="{x:Type TextBoxBase}">
                    <Border Background="{TemplateBinding Background}" 
                x:Name="Bd" BorderBrush="WhiteSmoke"
                BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10" >
                        <ScrollViewer x:Name="PART_ContentHost"/>
                    </Border>
                    <!--<ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" TargetName="Bd"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="Width" Value="Auto">
                            <Setter Property="MinWidth" Value="100"/>
                        </Trigger>
                        <Trigger Property="Height" Value="Auto">
                            <Setter Property="MinHeight" Value="20"/>
                        </Trigger>
                    </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Grid.Resources>
            <!-- Main content container -->
            <Grid.RowDefinitions>
                <RowDefinition Height="0.4*" />
                <RowDefinition Height="0.3*" />
                <RowDefinition Height="0.3*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="250"/>
                <ColumnDefinition Width="50"/>
                <ColumnDefinition Width="250"/>
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource titleText}"  Content="Temperature Conversion" Margin="10,5,10,10"/>
            <!--<Border Grid.Row="1" Grid.Column="0" CornerRadius="10" BorderThickness="1" BorderBrush="Black">
            <TextBox Grid.Row="1" Grid.ColumnSpan="1"   BorderThickness="2"  Name="txtContents" TextAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
            </Border>-->
            <!--<Border  Grid.Row="1" Grid.ColumnSpan="1"  Margin="5" Padding="5" BorderThickness="1" BorderBrush="Red" Background="AntiqueWhite" CornerRadius="10">-->
            <TextBox Text="{Binding Celsius, UpdateSourceTrigger=PropertyChanged}" Name="txtCelsius" FontSize="24"  Grid.Row="1" Grid.ColumnSpan="1" Template="{StaticResource TextBoxBaseControlTemplate}"  BorderThickness="2" TextAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
            <!--</Border>-->
            <Label Grid.Row="2" Grid.ColumnSpan="1" Style="{StaticResource titleText}" Content="Celsius" Width="{Binding ElementName=txtCelsius, Path=ActualWidth}" />
            <TextBlock Text="=" FontSize="44" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" />
            <TextBox Text="{Binding Farenheit, UpdateSourceTrigger=PropertyChanged}" Name="textFahrenheit" FontSize="24" Grid.Row="1" Grid.Column="2" Template="{StaticResource TextBoxBaseControlTemplate}"  BorderThickness="2" TextAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
            <Label Grid.Row="2" Grid.Column="2" Style="{StaticResource titleText}" Content="Fahrenheit" Width="{Binding ElementName=textFahrenheit, Path=ActualWidth}"/>
            <!--<Button Grid.Row="3" Grid.Column="0" Content="Action" Height="113" HorizontalAlignment="Left"  Name="button1" VerticalAlignment="Top" Width="127" Command="{Binding Path=Action}" />
            <Button Grid.Row="3" Grid.Column="2" Content="En/Disable" Height="113" HorizontalAlignment="Left" Name="button2" VerticalAlignment="Top" Width="127" Command="{Binding Path=EnDisable}" />-->

        </Grid>
    </Border>

</Window>
